<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">  
  <title>家具花列表</title>
 </head>
 <body>
 
 <?php
  require_once('inc_admin.php');

  connect();
  //编写sql语句
  $id = $_GET['id'];
  $sql="select jiaju.*,category.xjn_cname from jiaju left join category on jiaju.xjn_cid=category.xjn_cid where jiaju.xjn_id={$id}";
  //echo $sql.'<br/>';  
  $result = fetch_array($sql);
 ?>
 <center><h3>家具列表</h3></center>
 <table align="center" width="80%" border=1> 
 <tr>
   <th>编号</th>
   <th width='80'>家具图片</th>
   <th>家具名称</th>   
   <th>家具产地（品牌）</th>
   <th>家具介绍</th>
   <th>家具类型</th>
   <th>家具添加时间</th>
   <th>是否审核</th> 
   <th>操作</th>
 </tr>

 <?php
  foreach ($result as $row) {
   echo '<tr>';
   echo '<td>'.$row['xjn_id'].'</td>';
   echo '<td><img src='.UserPhotoPath.$row['xjn_jiajulink'].' width=100 height=90 alt="无图片"></td>';
   echo '<td>'.$row['xjn_name'].'</td>'; 
   echo '<td>'.$row['xjn_brand'].'</td>';
   echo '<td>'.$row['xjn_intro'].'</td>';
   echo '<td>'.$row['xjn_cname'].'</td>'; 
   echo '<td>'.$row['xjn_adddate'].'</td>';
   if($row['xjn_ischecked']==0)
  {
    $row['xjn_ischecked']='未审核';
  }
  if($row['xjn_ischecked']==1)
  {
    $row['xjn_ischecked']='审核';
  }
   echo '<td>'.$row['xjn_ischecked'].'</td>';
   echo '<td><a href="flowerEditForm.php?id='.$row['xjn_id'].' ">修改</a> | 
   <a href="del.php?id='.$row['xjn_id'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a> |
   <a href="list.php?id='.$row['xjn_id'].' ">返回</a></td>';
   echo '</tr>';  
  }
  echo '</table>';  
  $totalrows = count($result);
  echo "<table align='center'><tr><td>共有{$totalrows}种家具</td></tr></table>";   
 ?>
 
 </body>
</html>